package qimao.com.edu.entity;

import jakarta.persistence.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * 作品表
 * @author 86173
 *
 */
//@Entity
//@Table(name = "works")
public class Works {
	/**
	 * 作品id
	 */
//    @Id
//    @Column(name = "work_id", nullable = false)
    private Integer workId;
    /**
	 * 用户id
	 */
//    @JoinColumn(name = "user_id", nullable = false)
    private int author;
    /**
	 * 作品名
	 */
//    @Column(name = "title", nullable = false, length = 100)
    private String title;
    /**
	 * 分类ID
	 */
//    @JoinColumn(name = "category_id", nullable = false)
    private int category;
    /**
	 * 封面
	 */
//    @Column(name = "cover", length = 255)
    private String cover;
    /**
	 * 简介
	 */
//    @Column(name = "description", columnDefinition = "TEXT")
    private String description;
    /**
	 * 章节数
	 */
//    @Column(name = "chapter_count", nullable = false, columnDefinition = "INT UNSIGNED DEFAULT 0")
    private Integer chapterCount;
    /**
	 * 字数
	 */
//    @Column(name = "word_count", nullable = false, columnDefinition = "INT UNSIGNED DEFAULT 0")
    private Integer wordCount;
    /**
	 * 价格
	 */
//    @Column(name = "price", nullable = false, precision = 10, scale = 2, columnDefinition = "DECIMAL(10, 2) DEFAULT 0.00")
    private Double price;
    /**
	 * 是否原创：0-非原创，1-原创
	 */
//    @Column(name = "is_original", nullable = false, columnDefinition = "TINYINT(1) DEFAULT 1")
    private int isOriginal;
    /**
	 * 是否VIP：0-普通作品，1-VIP作品，2-付费作品
	 */
//    @Column(name = "vip_type", nullable = false, columnDefinition = "TINYINT DEFAULT 0")
    private Integer vipType; // 0-普通作品，1-VIP作品，2-付费作品
    /**
	 * 状态：0-待审核，1-审核通过，2-审核不通过，3-下架
	 */
//    @Column(name = "status", nullable = false, columnDefinition = "TINYINT DEFAULT 0")
    private Integer status; // 0-待审核，1-审核通过，2-审核不通过，3-下架
    /**
	 * 是否完结：0-未完结，1-已完结
	 */
//    @Column(name = "is_finished")
    private int state;
    
    /**
     * 发布时间
     */
//    @Column(name = "publish_time")
    private LocalDateTime publishTime;
    
    /**
	 * 更新或完结时间
	 */
//    @Column(name = "update_time")
    private LocalDateTime updateTime;
    /**
	 * 收藏数
	 */
//    @Column(name = "favorites_count", nullable = false, columnDefinition = "INT UNSIGNED DEFAULT 0")
    private Integer favoritesCount;
    /**
	 * 阅读数
	 */
//    @Column(name = "read_count", nullable = false, columnDefinition = "INT UNSIGNED DEFAULT 0")
    private Integer readCount;
    /**
	 * 热度
	 */
//    @Column(name = "popularity", nullable = false, columnDefinition = "FLOAT DEFAULT 0")
    private Float popularity;
    
	public Works() {
		super();
	}

	public Works(Integer workId, int author, String title, int category, String cover, String description,
			Integer chapterCount, Integer wordCount, Double price, int isOriginal, Integer vipType, Integer status,
			int state, LocalDateTime publishTime, LocalDateTime updateTime, Integer favoritesCount, Integer readCount,
			Float popularity) {
		super();
		this.workId = workId;
		this.author = author;
		this.title = title;
		this.category = category;
		this.cover = cover;
		this.description = description;
		this.chapterCount = chapterCount;
		this.wordCount = wordCount;
		this.price = price;
		this.isOriginal = isOriginal;
		this.vipType = vipType;
		this.status = status;
		this.state = state;
		this.publishTime = publishTime;
		this.updateTime = updateTime;
		this.favoritesCount = favoritesCount;
		this.readCount = readCount;
		this.popularity = popularity;
	}

	public Integer getWorkId() {
		return workId;
	}

	public void setWorkId(Integer workId) {
		this.workId = workId;
	}

	public int getAuthor() {
		return author;
	}

	public void setAuthor(int author) {
		this.author = author;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getCategory() {
		return category;
	}

	public void setCategory(int category) {
		this.category = category;
	}

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getChapterCount() {
		return chapterCount;
	}

	public void setChapterCount(Integer chapterCount) {
		this.chapterCount = chapterCount;
	}

	public Integer getWordCount() {
		return wordCount;
	}

	public void setWordCount(Integer wordCount) {
		this.wordCount = wordCount;
	}

	public Double getPrice() {
		return price;
	}

	public void setPrice(Double price) {
		this.price = price;
	}

	public int getIsOriginal() {
		return isOriginal;
	}

	public void setIsOriginal(int isOriginal) {
		this.isOriginal = isOriginal;
	}

	public Integer getVipType() {
		return vipType;
	}

	public void setVipType(Integer vipType) {
		this.vipType = vipType;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public LocalDateTime getPublishTime() {
		return publishTime;
	}

	public void setPublishTime(LocalDateTime publishTime) {
		this.publishTime = publishTime;
	}

	public LocalDateTime getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(LocalDateTime updateTime) {
		this.updateTime = updateTime;
	}

	public Integer getFavoritesCount() {
		return favoritesCount;
	}

	public void setFavoritesCount(Integer favoritesCount) {
		this.favoritesCount = favoritesCount;
	}

	public Integer getReadCount() {
		return readCount;
	}

	public void setReadCount(Integer readCount) {
		this.readCount = readCount;
	}

	public Float getPopularity() {
		return popularity;
	}

	public void setPopularity(Float popularity) {
		this.popularity = popularity;
	}

	@Override
	public String toString() {
		return "Works [workId=" + workId + ", author=" + author + ", title=" + title + ", category=" + category
				+ ", cover=" + cover + ", description=" + description + ", chapterCount=" + chapterCount
				+ ", wordCount=" + wordCount + ", price=" + price + ", isOriginal=" + isOriginal + ", vipType="
				+ vipType + ", status=" + status + ", state=" + state + ", publishTime=" + publishTime + ", updateTime="
				+ updateTime + ", favoritesCount=" + favoritesCount + ", readCount=" + readCount + ", popularity="
				+ popularity + "]";
	}

	
}
